package com.attendance.util;

public class AttendanceStatusUtils {
    /**
     * 状态码转字符串
     * @return
     */
    public static String statusToString(Integer code){
        switch (code){
            case 0: return "请假";
            case 1: return "迟到";
            case 2: return "早退";
            case 3: return "旷课";
            case 4: return "正常";
        }
        return "";
    }
    /**
     * 字符串转状态码
     * @return
     */
    public static Integer statusToString(String str){
        switch (str){
            case "请假": return 0;
            case "迟到": return 1;
            case "早退": return 2;
            case "旷课": return 3;
            case "正常": return 4;
        }
        return -1;
    }
}
